﻿
using System;

namespace Client.Hotfix
{
    /// <summary>
    /// 客户端-游戏服 websocket 会话类
    /// </summary>
    public class C2GWSSession : WSSession
    {
        private NetService net;
        protected override void OnConnected(bool connResult)
        {
            net ??= Api.Instance.Get<NetService>();
            net?.OnConnectedHandle();
        }

        protected override void OnReceiveMessage(byte[] buffer)
        {
            net?.C2G_WS_Client?.OnReceiveMessage(buffer);
        }

        protected override void OnReceiveMessage(string message)
        {
            net?.C2G_WS_Client?.OnReceiveMessage(message);
        }

        protected override void OnDisConnected()
        {
            net?.OnDisconnectedHandle();
        }
    }

}
